Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rmwc/list

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmwc/list

RMWC List component

  • 5.7.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2K
decreased by-46.35%
Maintainers
1
Weekly downloads
 
Created
Source

Lists

Lists are continuous, vertical indexes of text or images.

  • Module @rmwc/list
  • Import styles:
    • import '@material/list/dist/mdc.list.css'
  • MDC Docs: https://material.io/develop/web/components/lists/

Basic Usage

<List>
  <ListItem>Cookies</ListItem>
  <ListItem>Pizza</ListItem>
  <ListItem>Icecream</ListItem>
</List>
<List twoLine>
  <ListItem>
    <ListItemGraphic icon="star_border" />
    <ListItemText>
      <ListItemPrimaryText>Cookies</ListItemPrimaryText>
      <ListItemSecondaryText>$4.99 a dozen</ListItemSecondaryText>
    </ListItemText>
    <ListItemMeta icon="info" />
  </ListItem>
  <ListItem>
    <ListItemGraphic icon="local_pizza" />
    <ListItemText>
      <ListItemPrimaryText>Pizza</ListItemPrimaryText>
      <ListItemSecondaryText>$1.99 a slice</ListItemSecondaryText>
    </ListItemText>
    <ListItemMeta icon="info" />
  </ListItem>
  <ListItem activated>
    <ListItemGraphic icon="mood" />
    <ListItemText>
      <ListItemPrimaryText>Icecream</ListItemPrimaryText>
      <ListItemSecondaryText>$0.99 a scoop</ListItemSecondaryText>
    </ListItemText>
    <ListItemMeta>Winner!</ListItemMeta>
  </ListItem>
</List>

Simplified Usage

While there are siutations where you would need / want to compose the entire list yourself, it can be quite verbose. SimpleListItem provides a compact syntax that allows you to pass all options as props. The following example is roughly equivalent to the one above.

<List twoLine>
  <SimpleListItem
    graphic="star_border"
    text="Cookies"
    secondaryText="Chocolate chip"
    metaIcon="info"
  />
  <SimpleListItem
    graphic="local_pizza"
    text="Pizza"
    secondaryText="Pepperoni"
    metaIcon="info"
  />
  <SimpleListItem
    activated
    graphic="mood"
    text="Icecream"
    secondaryText="Chocolate cookie dough"
    meta="Winner!"
  />
</List>

ListItem

A ListItem component.

Props

NameTypeDescription
activatedundefined | false | trueA modifier for an active state.
disabledundefined | false | trueA modifier for a disabled state.
rippleRipplePropTAdds a ripple effect to the component
selectedundefined | false | trueA modifier for a selected state.

ListItemPrimaryText

Primary Text for the ListItem

ListItemSecondaryText

Secondary text for the ListItem

ListItemGraphic

A graphic / icon for the ListItem

Props

NameTypeDescription
iconRMWC.IconPropTThe icon to use. This can be a string for a font icon, a url, or whatever the selected strategy needs.

ListItemMeta

Meta content for the ListItem. This can either by an icon by setting the icon prop, or any other kind of content.

Props

NameTypeDescription
iconRMWC.IconPropTThe icon to use. This can be a string for a font icon, a url, or whatever the selected strategy needs.

ListDivider

A divider for the List

ListGroup

A container to group ListItems

ListGroupSubheader

A subheader for the ListGroup

SimpleListItem

A simple list item template.

Props

NameTypeDescription
activatedundefined | false | trueA modifier for an active state.
childrenReact.ReactNodeChildren to render
disabledundefined | false | trueA modifier for a disabled state.
graphicRMWC.IconPropTA graphic icon for the ListItem.
metaReact.ReactNodeMeta content for the ListItem instead of an icon.
metaIconRMWC.IconPropTA meta icon for the ListItem
rippleRipplePropTAdds a ripple effect to the component
secondaryTextReact.ReactNodeSecondary Text for the ListItem.
selectedundefined | false | trueA modifier for a selected state.
textReact.ReactNodeText for the ListItem.

Keywords

FAQs

Package last updated on 10 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc